/////////////////////////////////////////////////////////////////////////////////////////////
// Filename: GraphicsOwnedStates.cpp
// (c) Dave Ottley, 2012. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////
//		INCLUDES
///////////////////////////
#include <assert.h>

///////////////////////////
//		MY INCLUDES
///////////////////////////
#include "D3DClass.h"
#include "GraphicsOwnedStates.h"
#include "GraphicsMessages.h"

//------------------------------------------------------methods for GraphicsNormalState
GraphicsNormalState * GraphicsNormalState::GetInstance()
{
	static GraphicsNormalState theOne;

	return &theOne;
}

void GraphicsNormalState::Enter( D3DClass * graphicsSubsystem)
{
	//...
}

void GraphicsNormalState::Execute( D3DClass * graphicsSubsystem)
{
	   
	//...

}

void GraphicsNormalState::Exit( D3DClass * graphicsSubsystem)
{
	//...
}

bool GraphicsNormalState::OnMessage( D3DClass * graphicsSubsystem, const Telegram& msg)
{
	switch(msg.Msg)
	{
	case GraphicsMsg::IsDeviceActive:
		{
			bool * temp = (bool *) msg.Msg;
			*temp = graphicsSubsystem->IsDeviceActive();
			return true;
		}
		
	case GraphicsMsg::ToggleFullscreen:
		graphicsSubsystem->ToggleFullscreen();
		return true;

	case GraphicsMsg::WindowResized:
		graphicsSubsystem->OnResize();
		return true;

	default:
		assert( false && "<GraphicsNormalState::OnMessage> Undefined Graphics Message Delivered. Cannot Handle.");
		return false;
		break;
	}
	
}

//------------------------------------------------------methods for GraphicsGlobalState
GraphicsGlobalState * GraphicsGlobalState::GetInstance()
{
	static GraphicsGlobalState theOne;

	return &theOne;
}

void GraphicsGlobalState::Enter( D3DClass * graphicsSubsystem)
{
	//...
}

void GraphicsGlobalState::Execute( D3DClass * graphicsSubsystem)
{
	   
	//...

}

void GraphicsGlobalState::Exit( D3DClass * graphicsSubsystem)
{
	//...
}

bool GraphicsGlobalState::OnMessage( D3DClass * graphicsSubsystem, const Telegram& msg)
{
	//...
	return true;
}